package com.etoak.controller;


import com.etoak.commons.vo.ResultVO;
import com.etoak.entity.Area;
import com.etoak.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author et2108
 * @since 2021-12-11
 */
@RestController
@RequestMapping("/area")
public class AreaController {
    @Autowired
    AreaService  areaService;


    @GetMapping
    public ResultVO getAreaList(@RequestParam(required = false, defaultValue = "100000")
                                            int parentId){

       List<Area>  areaList = areaService.queryList(parentId);

        return ResultVO.success(areaList);
    }

}

